<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <h1>B页面 :xx </h1>
  <script>
    const { search } = location; // ?key=11&name=11

    // 类似键值对的 对象的方式 来获取数据 
    // obj.key = 11 
    // obj.name=11


    const usp = new URLSearchParams(search);
    console.log(usp.get("key"));
    console.log(usp.get("name"));


  </script>
</body>

</html>